How to "get listView column heading"?

I've got some generic functions that take a listView and export the contents to .CSV or directly to Excel.

Is there any way to get the column headings of a listView?
djakad - Mon Mar 01 15:55:17 EST 2010

Re: How to "get listView column heading"?
Mathias Mamsch - Mon Mar 01 18:20:05 EST 2010

Nope ... But you hook the "insertColumn" function by your own one to store the titles of the listviews when they are created. You would have to make sure that your include library is included before the creation of the listview. Note that this won't work for example if you do not insert the columns from left to right or the user moves the columns around, but I hope it gives you a basic idea how to handle such problems.

Regards, Mathias

Re: How to "get listView column heading"?
Mathias Mamsch - Mon Mar 01 18:24:26 EST 2010

I cannot post my example code. He tells me "disallowed content" ... grrr ... find it attached.
Attachments

attachment_14440852_code.txt

Re: How to "get listView column heading"?
llandale - Tue Mar 02 16:39:51 EST 2010

Mathias Mamsch - Mon Mar 01 18:24:26 EST 2010
I cannot post my example code. He tells me "disallowed content" ... grrr ... find it attached.

Its spelled 'Oops'.

Its the 4-letter word that starts with T and ends with T and has only 3-letters.

What does that 4th 'bool' parameter do for the put(Skip) command?

VERY clever temporary replacement of an existing command. Been wondering how to do that. Of course, if it was VERY VERY clever you'd also replace the existing 'listView' command such that it stores the column titles and numbers in a new Skip list, which is itself stored inside a Global Skip list,with key DBE. That way your functions can work on any number of ListViews in the code.

  • Louie

Re: How to "get listView column heading"?
Mathias Mamsch - Tue Mar 02 18:18:56 EST 2010

llandale - Tue Mar 02 16:39:51 EST 2010
Its spelled 'Oops'.

Its the 4-letter word that starts with T and ends with T and has only 3-letters.

What does that 4th 'bool' parameter do for the put(Skip) command?

VERY clever temporary replacement of an existing command. Been wondering how to do that. Of course, if it was VERY VERY clever you'd also replace the existing 'listView' command such that it stores the column titles and numbers in a new Skip list, which is itself stored inside a Global Skip list,with key DBE. That way your functions can work on any number of ListViews in the code.

  • Louie

heh ... now I see the 3 letter word :-) and in germany it is "ups", forgot to translate g

Lets get back to the code. I did not get your argument about hooking the listview function too. That function does not know about column titles. The code already works with more than one listview since ((addr_ dbeListview) int ) "_" columnNr will create different keys for different DBEs. And I think even if you reorder your listview that getColumnValue(...) will give you the value of the original column. So the code should work fine. Can you elaborate on your idea?

Regards, Mathias

Re: How to "get listView column heading"?
llandale - Wed Mar 03 16:02:24 EST 2010

Mathias Mamsch - Tue Mar 02 18:18:56 EST 2010
heh ... now I see the 3 letter word :-) and in germany it is "ups", forgot to translate g

Lets get back to the code. I did not get your argument about hooking the listview function too. That function does not know about column titles. The code already works with more than one listview since ((addr_ dbeListview) int ) "_" columnNr will create different keys for different DBEs. And I think even if you reorder your listview that getColumnValue(...) will give you the value of the original column. So the code should work fine. Can you elaborate on your idea?

Regards, Mathias

Mental note: double check criticisms of Mamsch. lol

What's that 4th bool parameter for?

Re: How to "get listView column heading"?
Mathias Mamsch - Thu Mar 04 17:36:47 EST 2010

llandale - Wed Mar 03 16:02:24 EST 2010
Mental note: double check criticisms of Mamsch. lol

What's that 4th bool parameter for?

You mean the 4th parameter of put(Skip, _x,_y_bool) ? It is to tell DOORS to replace an existing value for a key, by default he will not replace values in a skip list, if you provide the same key twice.

Regards, Mathias